<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" import="java.util.*,BEAN.*" %>
<%@ page session="true" %>  
<jsp:include page="/menu.jsp"></jsp:include>
<div id="content">
		
		<h3>Editar Usu&aacute;rio</h3>
		
		<% ArrayList<String> mensagens = (ArrayList<String>) session.getAttribute("erro");
			if (mensagens != null){
				for (String mensagem : mensagens){%>
		     	   	<%=mensagem.toString()%>
		     	   	<br/>
			        <%}
			    mensagens.clear();
			    session.setAttribute("erro", mensagens); 
		        
	        }%>
		<br/>	
		
	<% UsuarioBean usuario = (UsuarioBean) session.getAttribute("usuario");
		int valor = 0;
		if (usuario.getCargo().equals("vendedor")) valor = 1;
		else {
			if (usuario.getCargo().equals("cliente")) valor = 2;
			else valor = 3;
		}
	
	
	%>
	<div style="position:absolute; margin-left: 370px;">
		<form  id="form1" action="/Livraria/livraria"  method="POST">
		   <h3>
		    <label>ID</label>
			   <input type="text" name="id" readonly="readonly" value="<%=usuario.getId()%>" /><br/><br/>
		    <label>Nome</label>
			   <input type="text" name="nome"  value="<%=usuario.getNome()%>" /><br/><br/>
			<label>Senha</label>
			    <input type="text" name="senha" value="<%=usuario.getSenha()%>" /><br/><br/>
			<label>Cargo</label>
			   <select name="cargo">
					<option value="1">vendedor</option>
					<option value="2">cliente</option>
					<option value="3">admin</option>
				</select><br/><br/>
		    </h3>
			<input style="width:100;height:25" type="submit" value="Cadastrar" />
			<input size="3" type="hidden" name="corrente" value="25">
		</form>
	</div>
</div>	
</body>
</html>
